package effectivejava.foreachbetterthanfor.oneloop;

import org.assertj.core.util.Lists;

import java.util.Collection;

public class ForEachExample {
    public static void main(String[] args) {
        Collection<Element> c = Lists.newArrayList(new Element("1"), new Element("2"), new Element("3"));
        for (Element e : c) {
            System.out.println(e);
        }
        Element[] a = new Element[]{new Element("1"), new Element("2"), new Element("3")};
        for (Element element : a) {
            System.out.println(element);
        }
    }
}
